﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShippingWeight.aspx.cs"
    Inherits="WMS6.Web.Outbound.ShippingWeight" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>ShippingWeight</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/calendar.js" type="text/javascript" charset="gb2312"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script type="text/javascript">
       
        //初始化页面
        window.onload = function(){
            initDetailPage();
        }
        function returnGoBack()
        {
            window.history.go(-1);
        }
        
          //弹出窗口选择货品
        function selectSku()
        {
            var rtnValue = popModalWindow('../Configuration/SkuQuery.aspx?action=txtPackingType&SkuClassID='+escape('包装材料')+'&ownerID=' + escape(document.getElementById("hdnOwnerID").value), 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {               
                document.getElementById("txtPackingType").value = rtnValue;                     
                RealWeight();          
            }
        }
        
       function RealWeight()
       {     
          document.getElementById('btnRealWeight').click();
       }
       
        //重量差异大于 货主设置 提示
        function Prompt()
        {
           if(confirm("实际包裹重量和系统包裹计重差异超出范围，是否继续？？"))
           {           
              document.getElementById("btnPrompt").click();
           }
        }
        
        function CalculatedWeight()
        {
           if(document.getElementById("txtRealWeight").value.length > 0)
           {
         
              document.getElementById("hdnRealWeight").vlaue = document.getElementById("txtRealWeight").vlaue;
              document.getElementById("btnRealWeight").click();
           }          
        }
        
        function checkDeliveryOrder()
        {
            if(document.getElementById("txtEndDeliveryOrder").value != '')
            {
                document.getElementById("txtOrderID").focus();
            }
            else
            {
                document.getElementById("txtEndDeliveryOrder").focus();
            }
        }
        
        function SetDeliveryOrder(obj)
        {
           if(obj.value!='')
           {
             document.getElementById('txtCurrentDeliveryOrder').value=obj.value;
              document.getElementById('hdnSetDeliveryOrder').value ='1';
             
           }
           checkDeliveryOrder();
        }
        function SetEndDeliveryOrder(obj)
        {
           if(obj.value!='')
           {
               document.getElementById("txtPackingType").focus();              
           }
        }
        function SetPackingType(obj)
        {
           if(obj.value!='')
           {
               document.getElementById("txtOrderID").focus();              
           }
        }
    </script>

</head>
<body>
    <div style="display: none">
        <object id="qtForm" classid="clsid:18E6FD94-05A1-4C86-B6A9-C9C4CB178236" codebase="qtForm.ocx"
            width="256" height="43" align="center" hspace="0" vspace="0">
        </object>
    </div>

    <script type="text/javascript">
        function doSetting() {
            qtForm.doSetting();
        }
        function doPrint() {
            var whID = document.getElementById("hdnWHID").value;
            var ownerID = document.getElementById("hdnOwnerID").value;
            var orderID = document.getElementById("hdnOrderID").value;
            qtForm.doPrint("PrintExpressDelivery", whID, orderID, ownerID);
        }
        function doPrintView() {
            var whID = document.getElementById("hdnWHID").value;
            var ownerID = document.getElementById("hdnOwnerID").value;
            var orderID = document.getElementById("hdnOrderID").value;
            qtForm.doPrintView("PrintExpressDelivery", whID, orderID, ownerID);
        }
    </script>

    <form id="F7091" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblASN" runat="server" CssClass="label_header" Text="出库称重" meta:resourcekey="lblASN"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Enabled="false" Text="刷新"
                            AccessKey="b"  />
                    </td>
                    <td>
                        <asp:Button ID="btnUpdatePackingType" OnClick="btnUpdatePackingType_Click" runat="server"
                            CssClass="button" Enabled="false" Text="修改包材" AccessKey="s" />
                    </td>
                    <td>
                        <asp:Button ID="btnDeliveryOrder" runat="server" CssClass="button" Enabled="false"
                            Text="批量打印" AccessKey="b" />
                    </td>
                    <td>
                        <asp:Button ID="btnCancelOrder" runat="server" CssClass="button" Enabled="false" OnClick="btnCancelOrder_Click"
                            Text="取消包裹" AccessKey="b" />
                        <a id="btnPrompt" runat="server" onserverclick="btnPrompt_Click"></a>
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
        </div>
        <div id="div_content">
            <div id="con_one_1" style="display: block;">
                <table width="1000px" style="display: block; margin-left: 10px; margin-top: 10px;">
                    <tr>
                        <td style="width: 100px">
                        </td>
                        <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblOrderID" runat="server" Text="订单号" meta:resourcekey="lblOrderID"></asp:Label><font
                                color="red">*</font>
                        </td>
                        <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblSysWeight" runat="server" Text="包裹系统计重" meta:resourcekey="lblSysWeight"></asp:Label>
                        </td>
                        <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblRealWeight" runat="server" Text="包裹实际计重" meta:resourcekey="lblRealWeight"></asp:Label><font
                                color="red">*</font>
                        </td>
                       
                          <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblCarrierID" runat="server" Text="承运商" meta:resourcekey="lblSysWeight"></asp:Label>
                        </td>
                         <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblDifferencesWtg" runat="server" Text="差异重量" meta:resourcekey="lblDiffWeight"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:CheckBox ID="chkDeliveryPrint" runat="server" CssClass="checkbox" Text="即时打印"
                                Checked="false" meta:resourcekey="chkDeliveryPrint" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtOrderID" runat="server" CssClass="textbox" OnTextChanged="txtOrderID_OnTextChanged"
                                AutoPostBack="true" meta:resourcekey="txtOrderID"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSysWeight" runat="server" CssClass="textbox" meta:resourcekey="txtSysWeight"
                                Enabled="False"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtRealWeight" runat="server" CssClass="textbox" onDataAvailable="CalculatedWeight();"
                                meta:resourcekey="txtRealWeight"></asp:TextBox>
                            <a id="btnRealWeight" runat="server" onserverclick="btnRealWeigh_Click"></a>
                        </td>                       
                       
                        <td>
                            <asp:TextBox ID="txtCarrierID" runat="server" CssClass="textbox" Enabled="False"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtDifferencesWtg" runat="server" CssClass="textbox" meta:resourcekey="txtRealWeight"
                                Enabled="False"></asp:TextBox>
                        </td>
                    </tr>
                  
                    <tr>
                         <td>
                            <asp:CheckBox ID="chkScanPack" runat="server" CssClass="checkbox" Text="扫描包材" Checked="false"
                                meta:resourcekey="chkScanPack" />
                        </td>
                          <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblPackingType" runat="server" Text="包材型号" meta:resourcekey="lblOrderID"></asp:Label>
                        </td>
                        <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblBeginDeliveryOrder" runat="server" Text="起始运单号" 
                                meta:resourcekey="lblBeginDeliveryOrder"></asp:Label><font
                                color="red">*</font>
                        </td>
                        <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblEndDeliveryOrder" runat="server" Text="结束运单号"
                                meta:resourcekey="lblEndDeliveryOrder"></asp:Label><font
                                color="red">*</font>
                        </td>
                        <td style="width: 180px">
                            <asp:Label CssClass="label" ID="lblCurrentDeliveryOrder" runat="server" Text="当前运单号"
                                meta:resourcekey="lblCurrentDeliveryOrder"></asp:Label><font
                                color="red">*</font>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                         <td>
                            <asp:TextBox ID="txtPackingType" runat="server" CssClass="textbox" meta:resourcekey="txtPackingType"></asp:TextBox><img
                                src="../Images/icon_find.gif" alt="select one item" class="img" onclick="selectSku();" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtBeginDeliveryOrder" runat="server" CssClass="textbox" meta:resourcekey="txtBeginDeliveryOrder"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtEndDeliveryOrder" runat="server" CssClass="textbox" meta:resourcekey="txtEndDeliveryOrder"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtCurrentDeliveryOrder" runat="server" CssClass="textbox" meta:resourcekey="txtCurrentDeliveryOrder"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </div>
            <div style="margin-left: 10px; margin-right: 10px; padding-bottom: 20px; height:350px; width:1000px
                overflow: auto;">
                <asp:GridView ID="gvWeightReview" runat="server" AllowSorting="False" AutoGenerateColumns="False"
                    CssClass="gridview" DataKeyNames="OrderID" OnRowDataBound="gvWeightReview_RowDataBound"
                    Width="1000px" meta:resourcekey="gvWeightReview">
                    <FooterStyle CssClass="GridViewFooterStyle" />
                    <RowStyle CssClass="GridViewRowStyle" />
                    <HeaderStyle CssClass="FixedHeader" />
                    <PagerStyle CssClass="GridViewPageStyle" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                    <Columns>
                        <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="No">
                            <ItemStyle CssClass="GridViewRowWidth_40" />
                        </asp:BoundField>
                        <asp:TemplateField meta:resourcekey="TemplateField">
                            <HeaderTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvWeightReview');"
                                    meta:resourcekey="CheckBox1" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvWeightReview');"
                                    meta:resourcekey="CheckBox2" />
                            </FooterTemplate>
                            <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                            <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="OrderID" HeaderText="订单号" FooterText="订单号" meta:resourcekey="OrderID">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                        <asp:BoundField DataField="StatusD" HeaderText="状态" FooterText="状态" meta:resourcekey="StatusD">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                        <asp:BoundField DataField="WaybillNo" HeaderText="运单号" FooterText="运单号" SortExpression="WaybillNo"
                            meta:resourcekey="WaybillNo">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                        <asp:TemplateField FooterText="是否打印" HeaderText="是否打印">
                            <ItemTemplate>
                                <asp:Label ID="lblIsPrint" runat="server" Text='<%# Eval("IsPrint") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:TemplateField>
                        <asp:TemplateField FooterText="打印次数" HeaderText="打印次数">
                            <ItemTemplate>
                                <asp:Label ID="lblPrintCount" runat="server" Text='<%# Eval("PrintCount") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="CarrierID" HeaderText="承运商" FooterText="承运商">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                          <asp:TemplateField FooterText="包裹实际重量" HeaderText="包裹实际重量" SortExpression="PackingType">
                            <ItemTemplate>
                                <asp:Label ID="lblActualWeight" runat="server" Text='<%# Eval("ActualWeight") %>' meta:resourcekey="PackingType"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:TemplateField>
                        <asp:TemplateField FooterText="包材型号" HeaderText="包材型号" SortExpression="PackingType">
                            <ItemTemplate>
                                <asp:Label ID="lblPackingType" runat="server" Text='<%# Eval("PackingType") %>' meta:resourcekey="PackingType"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="ReferenceNum" HeaderText="销售订单号" FooterText="销售订单号" SortExpression="ReferenceNum"
                            meta:resourcekey="ORDER_KIND_QTY">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                    </Columns>
                </asp:GridView>
            </div>
            <div id="div_menu">
                <div style="float: left; width: 8px;">
                    <div class="tabL" id="div6">
                    </div>
                </div>
                <div style="float: left;" class="tabLabelCont tabCur" onclick="setTab('one',1,1)"
                    id="div7">
                    <span id="Label2" class="hover">已撤销</span>
                </div>
                <div style="float: left; margin-right: 2px;">
                    <div class="tabR" id="div8">
                    </div>
                </div>
            </div>
            <div style="margin-left: 10px; margin-right: 10px; padding-bottom: 20px; height:120px; width:1000px
                overflow: auto;">
                <asp:GridView ID="gvWeightCancelReview" runat="server" AllowSorting="false" AutoGenerateColumns="False"
                    PageSize="10" CssClass="gridview" DataKeyNames="OrderID" OnRowDataBound="gvWeightCancelReview_RowDataBound"
                    AllowPaging="True" Width="1000px" meta:resourcekey="gvWeightCancelReview">
                    <FooterStyle CssClass="GridViewFooterStyle" />
                    <RowStyle CssClass="GridViewRowStyle" />
                    <HeaderStyle CssClass="FixedHeader" />
                    <PagerStyle CssClass="GridViewPageStyle" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                    <Columns>
                        <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="No">
                            <ItemStyle CssClass="GridViewRowWidth_40" />
                        </asp:BoundField>
                        <asp:TemplateField meta:resourcekey="TemplateField">
                            <HeaderTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvWeightCancelReview');"
                                    meta:resourcekey="CheckBox1" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvWeightCancelReview');"
                                    meta:resourcekey="CheckBox2" />
                            </FooterTemplate>
                            <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                            <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="OrderID" HeaderText="订单号" FooterText="订单号" meta:resourcekey="OrderID">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                        <asp:BoundField Visible="false" DataField="StatusD" HeaderText="状态" FooterText="状态" meta:resourcekey="StatusD">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                         <asp:TemplateField FooterText="是否打印" HeaderText="是否打印">
                            <ItemTemplate>
                                <asp:Label ID="lblIsPrint" runat="server" Text='<%# Eval("IsPrint") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:TemplateField>
                        <asp:TemplateField FooterText="打印次数" HeaderText="打印次数">
                            <ItemTemplate>
                                <asp:Label ID="lblPrintCount" runat="server" Text='<%# Eval("PrintCount") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="CarrierID" HeaderText="承运商" FooterText="承运商">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ReferenceNum" HeaderText="销售订单号" FooterText="销售订单号" SortExpression="ReferenceNum"
                            meta:resourcekey="ORDER_KIND_QTY">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                        <asp:BoundField DataField="OwnerID" HeaderText="货主" FooterText="货主" SortExpression="OwnerID"
                            meta:resourcekey="OwnerID">
                            <ItemStyle CssClass="GridViewRowWidth_100" />
                        </asp:BoundField>
                    </Columns>
                </asp:GridView>
            </div>
            <div style="height: 20px;">
            </div>
        </div>
         <input id="hdnActionID" type="hidden" runat="server" />
        <input type="hidden" id="hdnDataFormat" runat="server" />
        <input type="hidden" id="hdncalendarFlag" runat="server" />
        <input type="hidden" id="hdnRealWeight" runat="server" />
        <input type="hidden" id="hdnOwnerID" runat="server" />
        <input type="hidden" id="hdnSetDeliveryOrder" runat="server" />
        <input type="hidden" id="hdnWHID" runat="server" />
        <input type="hidden" id="hdnOrderID" runat="server" />
        </ContentTemplate>
        </asp:UpdatePanel>
       
    </div>
    </form>
</body>
</html>
